package org.qiyu.live.im.provider.service.impl;

import jakarta.annotation.Resource;
import org.qiyu.live.im.core.server.interfaces.constants.ImCoreServerConstants;
import org.qiyu.live.im.provider.service.ImOnlineRpcService;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

/**
 * @Description: TODO
 * @Author zhangguangyan
 * @Date 2023/10/03/ 00:08:09
 */
@Service
public class ImOnlineRpcServiceImpl implements ImOnlineRpcService {
    @Resource
    private RedisTemplate<String,Object> redisTemplate;
    @Override
    public boolean isOnline(long userId, int appId) {
        return redisTemplate.hasKey(ImCoreServerConstants.IM_BIND_IP_KEY+appId+":"+userId);
    }
}
